$(function(){
	
	/***获取最近浏览的商品*****/
	$.ajax({
		url : rootPath+"/tracks/latelyTracks",
		type : "post",
		async : false,
		success : function(data, status) {
			//移除已有的标签元素数据
			$(".informationG  li ul > li").empty();
			//遍历结果信息
			$.each(data, function(i,result){ 
				var img = result.picture;
				if(img==null){
					img =" 	<a href='"+rootPath+"/goods/queryGoodsDetail?id="+result.goodsId+"' target='_blank'><img src='"+rootPath+"/images/more1.png' alt='"+result.goodsName+"' /> </a>"
				}else{
					img =" <a href='"+rootPath+"/goods/queryGoodsDetail?id="+result.goodsId+"' target='_blank'><img src='"+baseFile+""+img+"' alt='"+result.goodsName+"' /></a> "
				}
				if(i < 2){
					//alert($(".informationG > li:eq(0)  ul > li").length);

					var info = ".informationG  li:eq(0)  ul > li:eq("+i+")";
					$(info).html(img
							+'<p class="moreWord " style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap">'+result.goodsName+'</p>'
							+'<p>'
							+'<span><b>￥ </b>'+result.marketPrice+'</span>'								
							+'</p>');
				}
				if(i > 1 && i<4){
					var ii = i-2;
					var info = ".informationG > li:last  ul > li:eq("+ii+")";
					$(info).html(img
							+'<p class="moreWord " style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap">'+result.goodsName+'</p>'
							+'<p>'
							+'<span><b>￥ </b>'+result.marketPrice+'</span>'								
							+'</p>');
				}
			});
		},
		error : function(xhr, status, e) {
			alert("失败错误信息"+e)
		}
	});
});